package com.backend.api.controller;

import com.common.service.TagsService;
import com.util.CommonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class TagsController {

    @Resource
    TagsService tagsService;


    @RequestMapping(value = "/search/tags", method = RequestMethod.GET)
    public CommonResult<Map<Long, String>> searchTags(
            @RequestParam(value = "tags") String tagsName
    ) {
        Map<Long, String> tags = tagsService.searchTags(tagsName);
        return CommonResult.success(tags);
    }

}
